home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 14
/
Hot Mix 14.iso
/
HTML
/
vendors
/
finesse
/
examples
/
csh
/
callbacks
next >
Wrap
Text File
|
1996-06-27
|
2KB
|
78 lines
#! /bin/csh
# FINESSEAPPLICATIONKEY sBqQOMJA}~`IV
#
if (! $?FINESSEPATH) set FINESSEPATH = /usr/local/finesse
source $FINESSEPATH/fscshinit
Fsopen -o 1
# csh window definition syntax depending on operating system
if ( "`uname`" == "SCO_SV" ) then
echo "csh not supported. Use 'tcsh' or convert to 'sh'."
exit 1
else if ( "`uname`" == "OSF1" ) then
set a = "FsWindow -name callback "
set aa = "-title 'Example Shell Callback';"
set b = "FsPushButton -label Button1 "
set ba = "-fsbutton b1 -winstat touch;"
set c = "FsPushButton -label Button2 "
set ca = "-fsbutton b2 -winstat touch;"
set d = "FsPushButton -label Button3 "
set da = "-fsbutton b3 -winstat touch;"
set e = "FsPushButton -label Button4 "
set ea = "-fsbutton b4 -winstat touch -nrows 2;"
set f = "FsRadio -items '1 2 3' -var num=1 "
set fa = "-fsbutton 123 -winstat touch;"
set g = "FsRadio -items '3 6 9' -var enum=3 "
set ga = "-label 'times 3' -fsbutton 369 -winstat touch;"
set windef = "$a$aa $b$ba $c$ca $d$da $e$ea $f$fa $g$ga"
else
set windef = "\
FsWindow -name callback -title 'Example Shell Callback';\
FsPushButton -label Button1 -fsbutton b1 -winstat touch;\
FsPushButton -label Button2 -fsbutton b2 -winstat touch;\
FsPushButton -label Button3 -fsbutton b3 -winstat touch;\
FsPushButton -label Button4 -fsbutton b4 -winstat touch\
-nrows 2;\
FsRadio -items '1 2 3' -var num=1\
-fsbutton 123 -winstat touch ;\
FsRadio -items '3 6 9' -var enum=3\
-label 'times 3' -fsbutton 369 -winstat touch;"
endif
if ( "`uname`" == "AIX" && "`uname -v`" == "4" ) then
set windefx = ($windef:x)
Fsdisplay -w "$windefx" -m "Push Callback Button:"
else
Fsdisplay -w $windef:q -m "Push Callback Button:"
endif
while (1)
switch ($fsbutton)
case b[1-4]:
set sub = "FsWindow -name s$fsbutton -btype o;"
echo Shell callback $fsbutton... > $FSSTDOUTFILE
Fsdisplay -w "$sub" -n s$fsbutton\
-m "Displaying subwindow $fsbutton..."
breaksw
case o:
Fsdisplay -n callback
breaksw
case 123:
set enum = `expr $num \* 3`
echo Shell callback $fsbutton... > $FSSTDOUTFILE
Fsdisplay -n callback -v enum=$enum
breaksw
case 369:
set num = `expr $enum / 3`
echo Shell callback $fsbutton... > $FSSTDOUTFILE
Fsdisplay -n callback -v num=$num
breaksw
default:
break
endsw
end
Fsclose